/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 artifact_prop_income.h

	$Header: /heroes4/artifact_prop_income.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( ARTIFACT_PROP_INCOME_H_INCLUDED )
#define ARTIFACT_PROP_INCOME_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "artifact_prop_effect.h"
#include "material_array.h"

namespace t_artifact_prop
{
	// ----------------------------------------------------------------------
	// class for income bonus
	// ----------------------------------------------------------------------
	class t_income : public t_base<k_artifact_effect_income>
	{
	public:
		t_income();
		t_income( t_material type, int amount );

		virtual t_artifact_effect*	clone() const;
		static t_artifact_effect*	create();

		virtual bool			accept( t_artifact_effect_visitor& visitor );
		t_material_array const& get_bonus() const;
		virtual bool			read( std::streambuf& buffer );
		void                    set_bonus( t_material type, int amount );
		void                    set_bonus( t_material_array const& arg );
		virtual bool			write( std::streambuf& buffer ) const;
	protected:
		t_material_array m_income;
	};

	inline t_income::t_income()
	{
	}

	inline t_income::t_income( t_material type, int amount )
	{
		m_income[type] = amount;
	}

	inline t_material_array const& t_income::get_bonus() const
	{
		return m_income;
	}

	inline void t_income::set_bonus( t_material_array const& arg )
	{
		m_income = arg;
	}

	inline void t_income::set_bonus( t_material type, int amount )
	{
		m_income[type] = amount;
	}
};

#endif // ARTIFACT_PROP_INCOME_H_INCLUDED